Repository navigation
Conversation
Raise the minimum Cap'n Proto version from 0.9 to 0.10.3. 0.10 added CallContextHook::from(), needed by the next commit to hold a reference to a request's call context. 0.10.3 is also the oldest 0.10 release not affected by CVE-2022-46149 so requiring directly allow us to drop the CVE check.
Replace cancel_mutex/cancel_lock with a reference to the request's call context (CallContextHook::from(call_context).addRef()), taken and released on the event loop thread. Cancellation no longer frees the params and results structs while a worker thread is using them, so on_cancel only sets an atomic request_canceled flag and never blocks the event loop thread waiting for the worker. This removes the class of deadlocks where a worker holding the lock waits for the event loop (destroy(), destroying ProxyClient params, any EventLoop::sync() call). The lock also kept the Connection alive while the worker used it, because ~Connection cancels requests through m_canceler and on_cancel blocked on the lock. Move the remaining Connection accesses on worker threads (building ProxyClient and ProxyServer objects, setting m_thread_map) onto the event loop thread with SyncValue()/syncRequest(), which skip the work and throw InterruptException if the request was canceled. Reading capabilities, including list items, also happens on the event loop thread now via GetCapability(), because ClientHook reference counts are not atomic.
Add "SyncValue:before" and "SyncValue:after" testing_hook_misc calls to SyncValue(), so tests can disconnect right before or after the worker thread builds a ProxyClient. Add a sumBars() method taking a list of interfaces, and check that canceling the request between list items interrupts the call instead of deadlocking when the already-read item's ProxyClient is destroyed. Also disconnect before and after a callback param's ProxyClient is built, to check that the worker never uses the server Connection after it is destroyed.
nullfail
force-pushed
the
no-cancel-lock
branch
from
December 4, 2026 03:48
6b698da to
b9e5f96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.